package com.xinqi.modules.exam.paper.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 是否公布答案，0:不公布； 1:到截止时间公布；
 *
 * @author linkai
 * @date 2023/7/2
 */
public enum IsPublishAnswerEnum implements BaseEnum {
    不公布("0", "不公布"),
    到截止时间公布("1", "到截止时间公布"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    IsPublishAnswerEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static IsPublishAnswerEnum of(String code) {
        return BaseEnum.of(IsPublishAnswerEnum.class, code);
    }
}
